#ifndef RESPONSE_H
#define RESPONSE_H

#include "parse.h"
#include <sys/socket.h>
#include <netinet/in.h>

// HTTP 错误响应常量
extern const char *RESPONSE_200;
extern const char *RESPONSE_400;
extern const char *RESPONSE_404;
extern const char *RESPONSE_500;
extern const char *RESPONSE_501;
extern const char *RESPONSE_505;

int set_response(Request *request, const struct sockaddr_in *cli_addr, char *response, size_t response_size, int server_port, char *body);
int get_connection_type(Request *request);
char *get_header_value(Request *request, const char *header_name);


#endif // RESPONSE_H